package com.jiangyg.mall.order.enums;

/**
 * 类描述：确认收货状态
 *
 * @author jiangyg
 * @date 2022-09-03
 */
public enum ConfirmStatus {

    UNCONFIRMED(0, "未确认"),

    CONFIRMED(1, "已确认");

    /**
     * 代码
     */
    public final int code;

    /**
     * 名称
     */
    public final String name;

    ConfirmStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 功能描述：根据代码判断值
     *
     * @param code 代码
     * @return ResourceType
     */
    public static ConfirmStatus decide(int code) {
        for (ConfirmStatus type : ConfirmStatus.values()) {
            if (type.code == code) {
                return type;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "ConfirmStatus [code=" + this.code + ", name=" + this.name + "]";
    }

}
